package com.gitee.wsl.ext.list

import kotlin.random.Random


fun <C> List<C>.shuffledFrom(startFrom: Int, rnd: Random = Random) = shuffled(startFrom until size, rnd)
fun <C> List<C>.shuffled(range: IntRange, rnd: Random = Random): List<C> {
    return slice(0 until range.first) + slice(range).shuffled(rnd) + slice(range.last + 1 until size)
}